home *** CD-ROM | disk | FTP | other *** search
- Path: news.telalink.net!news
- From: carl@tashian.com (Carl Tashian)
- Newsgroups: comp.lang.c
- Subject: Tree database?
- Date: Fri, 05 Jan 1996 20:53:14 GMT
- Organization: Telalink Corporation, Nashville, TN, USA
- Message-ID: <30ed88e4.66565357@news.telalink.net>
- NNTP-Posting-Host: carl.tashian.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=ISO-8859-1
- Content-Transfer-Encoding: 8BIT
- X-Newsreader: Forte Agent .99c/16.141
-
- I'm looking for a way to make and manage a tree database.. not just a
- binary tree, but one with infinite (HD space limited) leaves and
- branches.. A good example of what I'm looking for is Yahoo.. how did
- they create it? So far, the only thing I can think of is to create a
- directory tree based on a plain old binary file...and that's what I've
- done, but it doesn't work as well as it could..
-
- example:
-
- struct file_data {
- int template_type; /* document or siteinfo */
- char title[256]; /* Document title */
- char uri[256]; /* Document URL */
- char desc[512]; /* Description */
- char keys[512]; /* Keywords */
- char author[256]; /* Author handle (e-mail) */
- char category[256]; /* categories */
- time_t created; /* date created */
- time_t expires; /* date to expire */
- long stats; /* bitvector for stats */
- };
-
- category might have "Business, Internet" in it. If so, an entry is
- added to an HTML file in Business/Internet...a category is created
- only when an entry exists in that category (there are no entries that
- define categories). rather than using the "symlinks" that Yahoo has, I
- can put an entry in more than one category ("Business, Internet;
- Hobbies, Internet").. but I can't have one category accessed from many
- places. although basing this directory tree on a binary file does
- allow for very easy searching, the thing I don't like about it is that
- all of the HTML files have to be deleted and rebuilt every time the
- database changes ...
-
- If I had it all working in real time (generating the categories as
- they are required), and pulled all of the entries matching "Business,
- Internet" when the user clicked on "Internet" under "Business", It'd
- be too slow.. (it would also have to find all categories below
- "Business, Internet" and list those on the same page as categories)
-
- so.. what's the secret to Yahoo? :)
-